using System.Windows;
using Tryit.Models;
using Tryit.ViewModels;

namespace Tryit.Views
{
    public partial class TemplateEditDialog : Window
    {
        private TemplateEditViewModel _viewModel;

        public TemplateEditDialog()
        {
            InitializeComponent();
            _viewModel = new TemplateEditViewModel();
            DataContext = _viewModel;
            _viewModel.SetWindow(this);
        }

        public TemplateEditDialog(CompositionTemplate template)
        {
            InitializeComponent();
            _viewModel = new TemplateEditViewModel(template);
            DataContext = _viewModel;
            _viewModel.SetWindow(this);
        }

        public CompositionTemplate Template => _viewModel?.Template;
    }
} 